﻿<phone:PhoneApplicationPage 
    x:Class="Coding4Fun.WheresMyCar.SettingsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    >

	<phone:PhoneApplicationPage.Resources>
		<Style x:Key="RadioButtonList" TargetType="ListBox">
			<Setter Property="BorderBrush" Value="{x:Null}" />
			<Setter Property="BorderThickness" Value="0" />
			<Setter Property="ItemContainerStyle">
				<Setter.Value>
					<Style TargetType="ListBoxItem" >
						<Setter Property="Margin" Value="2" />
						<Setter Property="Template">
							<Setter.Value>
								<ControlTemplate TargetType="ListBoxItem">
									<Border Background="Transparent">
										<RadioButton IsHitTestVisible="False" IsChecked="{TemplateBinding IsSelected}">
											<ContentPresenter />
										</RadioButton>
									</Border>
								</ControlTemplate>
							</Setter.Value>
						</Setter>
					</Style>
				</Setter.Value>
			</Setter>
		</Style>
	</phone:PhoneApplicationPage.Resources>
	
    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="24,24,0,12">
            <TextBlock x:Name="ApplicationTitle" Text="WHERE'S MY CAR" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="settings" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <TextBlock Grid.Row="1" Text="Measurement" />
        <ListBox Grid.Row="2" Style="{StaticResource RadioButtonList}" ItemsSource="{Binding MeasurementUnits}" SelectedItem="{Binding MeasurementUnit, Mode=TwoWay}" Margin="10,0,0,0" />
        <TextBlock Grid.Row="3" Text="Map display" />
        <ListBox Grid.Row="4" Style="{StaticResource RadioButtonList}" ItemsSource="{Binding MapModes}" SelectedItem="{Binding MapMode, Mode=TwoWay}" Margin="10,0,0,0" />
    </Grid>

</phone:PhoneApplicationPage>
